package org.sith.taskrunner.api.task;

import org.sith.taskrunner.api.exceptions.TaskExecutionException;
import org.sith.taskrunner.api.exceptions.TaskInitException;

import java.io.Serializable;

/**
 * The task interface.
 * 
 * @param <I>
 *            type of input data for task
 * @param <T>
 *            type of result data of executing task
 */

public interface Task<I extends TaskInputData, T extends TaskExecutionResult> extends Serializable{
	/**
	 * Init input data
	 * @param inputData data for task
	 * @throws TaskInitException
	 */
	public void init(I inputData) throws TaskInitException;

    /**
	 *  Execute task
	 * @return result of execute task
	 * @throws TaskExecutionException
	 */
	public T executeTask() throws TaskExecutionException;
}
